<div class="row">
    <div class="col-md-12">
        <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title">List of profiles</h3>
            </div>
            <div class="box-body">
                <div ng-include="'views/partials/admin/profile/list/toolbar.html'"></div>

                <!-- Datalist  -->
                <div class="row mt-s">
                    <div class="col-md-12">
                        <table class="table table-striped case-list">
                            <thead>
                                <tr>
                                    <th style="width: 300px">Name</th>
                                    <th>Permissions</th>
                                    <th style="width: 150px"></th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-repeat="profile in $vm.list | orderBy:'name'">
                                    <td>
                                        <div class="profile-name">
                                            {{::profile.name}}
                                        </div>
                                    </td>
                                    <td class="wrap">
                                        <span class="label label-default mr-xxs mb-xxs" ng-repeat="permission in profile.permissions | orderBy:identity">{{permission}}</span>
                                        <em class="text-warning" ng-if="!profile.permissions || profile.permissions.length === 0">No permissions</em>
                                    </td>
                                    <td class="text-left nowrap" ng-if="$vm.canDelete(profile)">
                                        <span class="clickable mr-xs text-primary nowrap" ng-click="$vm.showProfile('edit', profile)">
                                            <i class="fa fa-edit"></i>Edit</span>

                                        <span class="clickable mr-xs text-danger nowrap" ng-click="$vm.removeProfile(profile)">
                                            <i class="fa fa-trash"></i>Delete</span>
                                    </td>
                                    <td class="text-left" ng-if="!$vm.canDelete(profile)">
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
